//
//  HNSH_GroupMembersChangeCell.m
//  HNSH_SingleProject
//
//  Created by 李宇廷 on 2023/2/17.
//

#import "HNSH_GroupMembersChangeCell.h"

@interface HNSH_GroupMembersChangeCell ()
/** */
@property (nonatomic, strong)UIImageView * imgView;
@end

@implementation HNSH_GroupMembersChangeCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self addAllViews];
        [self addAllLayout];
    }
    return self;
}

//MARK: Myself Methods
- (void)addAllViews{
    [self.contentView addSubview:self.imgView];
}

- (void)addAllLayout{
    [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(0);
        make.left.right.mas_equalTo(0);
        make.height.mas_equalTo(self.imgView.mas_width).multipliedBy(1);
    }];
}

//MARK: Setter Methods
- (void)setIsDelete:(BOOL)isDelete{
    _isDelete = isDelete;
    
    self.imgView.image = isDelete ? [UIImage imageNamed:@"chat_qun_setup_del"] : [UIImage imageNamed:@"chat_qun_setup_add"];
}

//MARK: Getter Methods
- (UIImageView *)imgView{
    if (!_imgView) {
        _imgView = [UIImageView new];
        _imgView.layer.cornerRadius = 8;
        _imgView.layer.masksToBounds = YES;
        _imgView.image = [UIImage imageNamed:@"chat_qun_setup_add"];
    }
    return _imgView;
}

@end
